package com.bruce.spring.http.client.controller;

import com.bruce.spring.http.client.monitor.JdkHttpClientMonitor;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by bruce in 2025/7/12 00:51
 */
@RequiredArgsConstructor
@RestController
public class MonitorController {

    private final JdkHttpClientMonitor jdkHttpClientMonitor;

    @RequestMapping("/getClientTracker")
    public Object getClientTracker(@RequestParam String name) {
        return jdkHttpClientMonitor.getClientTracker(name);
    }

    @RequestMapping("/getClientConnections")
    public Object getClientConnections(@RequestParam String name) {
        return jdkHttpClientMonitor.connectionsMonitor(name);
    }


}
